package org.qiyu.live.bank.dto;

import java.io.Serial;
import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-11-03
 * Time: 19:49
 */
public class AccountTradeRespDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 6713322757301572386L;

    private int code;
    private Long userId;
    private int num;
    private boolean isSuccess;
    private String msg;

    public static AccountTradeRespDTO buildSuccess(Long userId, String msg) {
        AccountTradeRespDTO accountTradeRespDTO = new AccountTradeRespDTO();
        accountTradeRespDTO.setMsg(msg);
        accountTradeRespDTO.setSuccess(true);
        accountTradeRespDTO.setUserId(userId);
        return accountTradeRespDTO;
    }

    public static AccountTradeRespDTO buildFail(Long userId, String msg,int code) {
        AccountTradeRespDTO accountTradeRespDTO = new AccountTradeRespDTO();
        accountTradeRespDTO.setMsg(msg);
        accountTradeRespDTO.setSuccess(false);
        accountTradeRespDTO.setUserId(userId);
        accountTradeRespDTO.setCode(code);
        return accountTradeRespDTO;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean success) {
        isSuccess = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "AccountTradeRespDTO{" +
                "userId=" + userId +
                ", num=" + num +
                ", isSuccess=" + isSuccess +
                ", msg='" + msg + '\'' +
                '}';
    }
}